//
//  SE_Item_VC.m
//  SkyEye
//
//  Created by dllo on 16/8/10.
//  Copyright © 2016年 SE. All rights reserved.
//

#import "SE_Item_VC.h"
#import "SE_Item_Model.h"
#import "SE_Item_View.h"

#define WIDTH self.view.frame.size.width
#define HEIGHT self.view.frame.size.height

@interface SE_Item_VC ()

@property (nonatomic, retain) UIButton *button;
@property (nonatomic, retain) SE_Item_View *itemView;

@end

@implementation SE_Item_VC

-(BOOL)prefersStatusBarHidden{
    return YES;
}

- (void)viewDidLoad {
    [super viewDidLoad];

    self.view.backgroundColor = [UIColor brownColor];
    
    [self createButton];
    
    [self createItemView];
    
    [self.view bringSubviewToFront:self.button];

}

-(void)createItemView{
    self.itemView = [[SE_Item_View alloc]initWithFrame:self.view.frame];
    [self.view addSubview:self.itemView];
    self.itemView.itemModel = self.itemModel;
}

-(void)createButton{
    self.button = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.view addSubview:self.button];
    self.button.frame = CGRectMake(10, 10, WIDTH * 0.05, HEIGHT * 0.05);
    [self.button setBackgroundImage:[UIImage imageNamed:@"down"] forState:UIControlStateNormal];
    [self.button addTarget:self action:@selector(backAction:) forControlEvents:UIControlEventTouchUpInside];
}

-(void)backAction:(UIButton *)button{
    [self dismissViewControllerAnimated:YES completion:nil];
}

-(void)setItemModel:(SE_Item_Model *)itemModel{
    _itemModel = itemModel;
}



@end














